package main

import "fmt"

type Employee struct {
	name    string
	company string
}

// 值方法
// 值方法的接收者是该方法所属的那个类型值的一个副本。我们在该方法内对该副本的修改一般都不会体现在原值上
func (e Employee) SetName(name string) {
	e.name = name
}

// 指针方法
func (e *Employee) setCompany(company string) {
	e.company = company
}

func main() {
	e := Employee{
		name:    "alex",
		company: "google",
	}
	fmt.Printf("=======:%s\n", e)

	e.SetName("zhangsan")
	fmt.Printf("=======:%s\n", e)

	e.setCompany("baidu")
	fmt.Printf("=======:%s\n", e)

}
